package com.flame.shapeville.component.task1.shape2D;

import javafx.scene.paint.Color;
import javafx.scene.shape.Polygon;

/**
 * Represents a regular hexagon used in Task 1.
 * <p>
 * This class draws a six-sided polygon with equal-length sides.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-12
 */
public class JfHexagon extends JfShape2D {

    /**
     * Constructs a new hexagon with the specified size.
     *
     * @param size the bounding box size for the hexagon
     */
    public JfHexagon(double size) {
        this.size = size;
        double x1 = size / 2 - size / 4 * Math.sqrt(3);
        double x2 = size / 2 + size / 4 * Math.sqrt(3);
        shape = new Polygon(
                size / 2, 0,
                x1, size / 4,
                x1, size / 4 * 3,
                size / 2, size,
                x2, size / 4 * 3,
                x2, size / 4
        );
        initBaseParams(Color.CYAN);
    }
}
